﻿using System;

using RaisingStudio.Data;
using RaisingStudio.Data.Common;
using RaisingStudio.Data.Expressions;

namespace RaisingStudio.Data.Common
{
    public interface IDataItemAdapter : ITransactionManager
    {      
        int Delete(object[] primaryKeys);
        int Delete(DataItem dataItem);
        int Delete(DataItem dataItem, string transactionID);
        int Delete(object[] primaryKeys, string transactionID);
    
        bool Exists(object[] primaryKeys);
        bool Exists(DataItem dataItem, string transactionID);
        bool Exists(DataItem dataItem);
        bool Exists(object[] primaryKeys, string transactionID);
   
        int Fill(DataItem dataItem, object[] primaryKeys);
        int Fill(DataItem dataItem, string transactionID);
        int Fill(DataItem dataItem, object[] primaryKeys, string transactionID);
        int Fill(DataItem dataItem, string[] columnNames, string transactionID);
        int Fill(DataItem dataItem, object[] primaryKeys, string[] columnNames, string transactionID);
        int Fill(DataItem dataItem, string[] columnNames);
        int Fill(DataItem dataItem, object[] primaryKeys, string[] columnNames);
        int Fill(DataItem dataItem);
   
        DataItem GetData(object[] primaryKeys, string transactionID);
        DataItem GetData(object[] primaryKeys);
        DataItem GetData(DataItem dataItem, string[] columnNames, string transactionID);
        DataItem GetData(DataItem dataItem, string transactionID);
        DataItem GetData(object[] primaryKeys, string[] columnNames, string transactionID);
        DataItem GetData(DataItem dataItem);
        DataItem GetData(DataItem dataItem, string[] columnNames);
        DataItem GetData(object[] primaryKeys, string[] columnNames);
     
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand, string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(CommonCommand conditionCommand, string transactionID);
        System.Collections.IList GetDataList(string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, string transactionID);
        System.Collections.IList GetDataList(int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IList GetDataList(string[] columnNames, int startRecord, int maxRecords);
        System.Collections.IList GetDataList(int startRecord, int maxRecords);
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IList GetDataList(CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IList GetDataList(string[] columnNames);
        System.Collections.IList GetDataList();
        System.Collections.IList GetDataList(string[] columnNames, CommonCommand conditionCommand);
        System.Collections.IList GetDataList(CommonCommand conditionCommand);
    
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, string transactionID);
        System.Collections.IEnumerable GetEnumerator(string transactionID);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand, string transactionID);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand, string transactionID);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator();
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator(CommonCommand conditionCommand);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames);
        System.Collections.IEnumerable GetEnumerator(int startRecord, int maxRecords);
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, CommonCommand conditionCommand);
    
        int Insert(DataItem dataItem);
        int Insert(DataItem dataItem, string[] columnNames);
        int Insert(DataItem dataItem, string transactionID);
        int Insert(DataItem dataItem, string[] columnNames, string transactionID);
    
        int Save(DataItem dataItem, string[] columnNames, string transactionID);
        int Save(DataItem dataItem);
        int Save(DataItem dataItem, string[] columnNames);
        int Save(DataItem dataItem, string transactionID);
   
        int Update(object[] primaryKeys, DataItem dataItem, string transactionID);
        int Update(DataItem dataItem, string transactionID);
        int Update(object[] primaryKeys, DataItem dataItem, string[] columnNames);
        int Update(object[] primaryKeys, DataItem dataItem);
        int Update(DataItem dataItem);
        int Update(DataItem dataItem, string[] columnNames);
        int Update(DataItem dataItem, string[] columnNames, string transactionID);
        int Update(object[] primaryKeys, DataItem dataItem, string[] columnNames, string transactionID);

        #region Extension Functions
        #region Common Methods
        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(RaisingStudio.Data.DataItem dataItem, object primaryKey);

        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(RaisingStudio.Data.DataItem dataItem, object primaryKey, string[] columnNames);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByPrimaryKey(object primaryKey);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByPrimaryKey(object primaryKey, string[] columnNames);

        /// <summary>
        /// Delete Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>The count of rows that updated.</returns>
        int DeleteByPrimaryKey(object primaryKey);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, RaisingStudio.Data.DataItem dataItem);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, RaisingStudio.Data.DataItem dataItem, string[] columnNames);

        /// <summary>
        /// Check the data item exists or not.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        bool ExistsByPrimaryKey(object primaryKey);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(CommonCommand conditionCommand);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(string[] columnNames, CommonCommand conditionCommand);

        #region Epxression 
        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        #region Batch Operation 
        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        #region Paging Operation 
        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);
        #endregion

        #region 迭代器
        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        #region Paging Operation 
        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);
        #endregion
        #endregion
        #endregion

        #region column name Epxression 
        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(RaisingStudio.Data.DataItem dataItem, object[] primaryKeys, ColumnExpression[] columnExpressions);

        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item that contains primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetData(object[] primaryKeys, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="dataItem">Data item that contains primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetData(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Insert Data item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Insert(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(object[] primaryKeys, RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Save Data item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Save(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, int startRecord, int maxRecords);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, int startRecord, int maxRecords);

        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(RaisingStudio.Data.DataItem dataItem, object primaryKey, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords);
        #endregion
        #endregion
        #endregion
        #region Transaction
        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(RaisingStudio.Data.DataItem dataItem, object primaryKey, string transactionID);

        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(RaisingStudio.Data.DataItem dataItem, object primaryKey, string[] columnNames, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByPrimaryKey(object primaryKey, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByPrimaryKey(object primaryKey, string[] columnNames, string transactionID);

        /// <summary>
        /// Delete Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        int DeleteByPrimaryKey(object primaryKey, string transactionID);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, RaisingStudio.Data.DataItem dataItem, string transactionID);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, RaisingStudio.Data.DataItem dataItem, string[] columnNames, string transactionID);

        /// <summary>
        /// Check the data item exists or not.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        bool ExistsByPrimaryKey(object primaryKey, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(CommonCommand conditionCommand, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(string[] columnNames, CommonCommand conditionCommand, string transactionID);

        #region Epxression 
        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        #region Batch Operation 
        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        #region Paging Operation 
        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);
        #endregion

        #region 迭代器
        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        #region Paging Operation 
        /// <summary>
        /// Gets the enumerator of data objects.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data objects.</returns>
        System.Collections.IEnumerable GetEnumerator(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(string[] columnNames, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);
        #endregion
        #endregion
        #endregion

        #region column name Epxression 
        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(RaisingStudio.Data.DataItem dataItem, object[] primaryKeys, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item that contains primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int Fill(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetData(object[] primaryKeys, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="dataItem">Data item that contains primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetData(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Insert Data item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Insert(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Update(object[] primaryKeys, RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Save Data item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int Save(RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// FillData item.
        /// </summary>
        /// <param name="dataItem">Data item.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The result of execute command.</returns>
        int FillByPrimaryKey(RaisingStudio.Data.DataItem dataItem, object primaryKey, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Update Data item.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="dataItem">Data item.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        int UpdateByPrimaryKey(object primaryKey, RaisingStudio.Data.DataItem dataItem, ColumnExpression[] columnExpressions, string transactionID);

        /// <summary>
        /// Gets Data item.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Data item.</returns>
        RaisingStudio.Data.DataItem GetDataByCondition(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets the list of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the list of data items.</returns>
        System.Collections.IList GetDataList(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID);

        /// <summary>
        /// Gets the enumerator of data items.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>the enumerator of data items.</returns>
        System.Collections.IEnumerable GetEnumerator(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID);
        #endregion
        #endregion
        #endregion
        #endregion
    }
}
